package com.ease.util {
   import flash.utils.Dictionary;

   /**
    * Represents a name (String) and  value (Object) pair.
    */
   public class NameValuePair {
      [Bindable]
      public var name:String;
      [Bindable]
      public var value:Object;

      [ArrayElementType("com.ease.util.NameValuePair")]
      /**
       * Returns a dictionary mapping the given <code>NameValuePair</code>
       * objects.
       */
      public static function toDictionary(pairs:Array):Dictionary {
         var result:Dictionary = new Dictionary();
         for each (var pair:NameValuePair in pairs) {
            result[pair.name] = pair.value;
         }
         return result;
      }
   }
}